package com.wm.blog.ws.controller;



import com.wm.blog.center.common.utils.R;
import com.wm.blog.center.entity.BlogEntity;
import com.wm.blog.center.service.BlogService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author: weiming
 * @Date: 2021/5/20 10:06
 * @Description:
 */
@RestController
@Api(tags = "博客主页接口")
public class IndexController {

    @Autowired
    BlogService blogService;

    @GetMapping("/index")
    public R getIndex(){

        List<BlogEntity> blogEntityList = blogService.list();

        return R.ok().put("data", blogEntityList);
    }

}
